package feeinterface.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ulwx.tool.DbUtils;
import feeinterface.modeldb.BasePhoneArea;

/**
 * 号码前7位。用于根据手机号码的前七位得到运营商,省份和地区
 * 
 * @author 黄杰
 * 
 */
public class BasePhoneAreaDao {
	/**
	 * g根据号码前7位 得到运营商,省份和地区
	 * 
	 * @param phone7
	 * @return
	 * @throws Exception
	 */
	public static BasePhoneArea getByPhone(String phone7) throws Exception {
		StringBuffer sb = new StringBuffer();
		sb.append("SELECT * ");
		sb.append("FROM BasePhoneArea WHERE Phone7=?");
		Map<Integer, Object> map = new HashMap<Integer, Object>();
		map.put(1, phone7);
		List<BasePhoneArea> list = DbUtils.doQueryClass(null,
				BasePhoneArea.class, sb.toString(), map);
		if (list.size() >= 1)
			return list.get(0);
		return null;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
